package com.tour.controller;


import com.tour.config.ResponseWrapper;
import com.tour.entity.SComment;
import com.tour.service.impl.SCommentServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lel
 * @since 2021-03-30
 */
@RestController
@Api(tags = "对店铺进行评论")
@RequestMapping("/app/comment")
public class SCommentController {

    @Autowired
    SCommentServiceImpl commentService;

    @ApiOperation("增加评论")
    @PostMapping("/addSComment")
    public ResponseWrapper addSComment(@RequestBody SComment comment){
        ResponseWrapper wrapper = commentService.addsComment(comment);
        return wrapper;
    }

    @ApiOperation("删除评论")
    @DeleteMapping("/deletesComment")
    public ResponseWrapper deleteSComment(@RequestParam(name = "scId")Integer scId){
        ResponseWrapper wrapper = commentService.dleleteComment(scId);
        return wrapper;
    }

}

